package com.copa.module.order.mapper;

import com.copa.module.order.domain.dto.OrderDetailDto;
import com.copa.module.order.domain.dto.OrderListDto;
import com.copa.module.order.domain.dto.OrderLogDto;
import com.copa.module.order.domain.entity.OrderEntity;
import com.copa.module.order.domain.vo.OrderAddVo;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author copa
 * @createDate 2021-01-25
 * @function t_order表 Mapper 接口
 */
@Mapper
public interface OrderDao extends BaseMapper<OrderEntity> {

    Long insertOrder(@Param("orderAddVo") OrderAddVo orderAddVo, @Param("userId") Long userId);

    Long selectLastOrderId(@Param("userId") Long userId);

    List<OrderListDto> list(@Param("orderStatus") Long orderStatus, @Param("userId") Long userId);

    OrderDetailDto findOrderDetailByOrderId(@Param("orderId") Long orderId, @Param("userId") Long userId);

    List<OrderLogDto> selectOrderLogByOrderGoodsSn(@Param("orderGoodsSn") String orderGoodsSn);
}
